package scyStudent

import (
	"github.com/gin-gonic/gin"
	"likeadmin/clog"
	"likeadmin/dbc"
	"likeadmin/model"
	"likeadmin/sqlop"
	"likeadmin/webu"
	"time"
)

func CreateScyStudent(c *gin.Context) {
	scyStudent := &model.ScyStudent{}
	c.ShouldBind(scyStudent)
	scyStudent.CreateTime = time.Now().Unix()
	clog.Info("scyStudent,CreateScyStudent,scyStudent=", scyStudent)
	err := dbc.DB.Create(scyStudent).Error
	webu.GinResult("CreateScyStudent Error:", c, err)
}

func UpdateScyStudent(c *gin.Context) {
	/*	scyStudent := &model.ScyStudent{}
		c.ShouldBind(scyStudent)
		clog.Info("scyStudent,UpdateScyStudent,scyStudent=", scyStudent)
		err := sqlop.ExecFourP("update scy_student set scy_student_name=?,scy_student_introduction=?,update_time=? where id=?", scyStudent.ScyStudentName, scyStudent.ScyStudentIntroduction, time.Now().Unix(), scyStudent.Id)
		webu.GinResult("UpdateScyStudent Error:", c, err)*/

}

func DeleteScyStudent(c *gin.Context) {
	scyStudent := &model.ScyStudent{}
	c.ShouldBind(scyStudent)
	clog.Info("scyStudent,DeleteScyStudent,scyStudent=", scyStudent)
	err := sqlop.ExecTwoP("update scy_student set is_deleted=1,delete_time=? where id=?", time.Now().Unix(), scyStudent.Id)
	webu.GinResult("DeleteScyStudent Error:", c, err)
}
